import request from '@/utils/request'

// 商品列表
export function search(param) {
  return request({
    url: '/drugProd/list',
    method: 'get',
    params: param
  })

}

// 上传图
export function uploadPicture(data) {
  return request({
    url: '/upload',
    method: 'post',
    data
  })
}

// 添加商品数据
export function addrug(data) {
  return request({
    url: '/drugProd/addrug',
    method: 'post',
    data
  })
}

// 单个删除
export function handleDelete(row) {
  return request({
    url: '/drugProd/handleDelete',
    method: 'get',
    params: {
      id: row.productId//当前id
    }
  })
}

// 删除多条
export function delBatch(ids) {
  return request({
    url: '/drugProd/delBatch',
    method: 'get',
    params: {
      ids: ids.join(",")
    }
  })
}

//编辑商品信息 redact
export function redact(data) {
  return request({
    url: '/drugProd/redact',
    method: 'post',
    data
  })
}
